import request from "@/utils/request.js";
import Cache from "@/utils/cache.js"
const url = '/salesman'

/**
 * 获取上级信息
 */
export function parentInfo(data) {
	return request.get(url + '/salesman/getParentInfo', data);
}
/**
 * 获取我的会议统计 /{salesmanId}/{year}/{month}

 */
export function getCountForSalesmanOur(salesmanId, year, month) {
	return request.get(url + `/salesman/getCountForSalesmanOur/${salesmanId}/${year}/${month}`);
}

/**
 * 获取我的队员统计
 */
export function myTeam(data) {
	return request.get(url + '/salesman/getMyTeam', data);
}

/**
 * 获取当月优胜签到最多
 */
export function maxCountSign(data) {
	return request.get(url + '/salesman/getMaxCountSign', data);
}

/**
 * 获取当月优胜领取最多
 */
export function maxCount(data) {
	return request.get(url + '/salesman/getMaxCount', data);
}

/**
 * 获取我的队员统计-按年查询
 */
export function MyTeamByYear(year) {
	return request.get(url + `/salesman/getMyTeamByYear/${year}`);
}

/**
 * 获取当前登录的业务员的所有下级
 */
export const selectSalesMan = (data) => {
	return request.post(url + `/salesManMeeting/selectCSalesMan`, data);
}

/**
 * 获取队员每月数量
 */
export const salesMan = (salesmanId, year) => {
	return request.get(url + `/salesman/getCountBySalesman/${salesmanId}/${year}`)
}

/**
 * 获取业务员信息
 */
export const getInfo = (data) => {
	return request.get(url + `/salesman/info`, data)
}

/**
 * 分组查询所有商品对应的服务总数以及使用次数
 */
export const groupGoodsService = (data) => {
	return request.post(url + `/goods_service_record_salesman/groupGoodsService`, data);
}

/**
 * 查询客户的各商品服务总数以及使用次数
 */
export const listGoodsService = (data) => {
	return request.post(url + `/goods_service_record_salesman/listGoodsService`, data);
}

/**
 * 管理员查询所有使用记录列表
 */
export const listAdmin = (data) => {
	return request.post(url + `/orderGoodsUsageSalesman/listAdmin`, data);
}